"""empty message

Revision ID: 332faa764121
Revises: ef8cf2222205
Create Date: 2025-11-19 20:05:41.307734

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '332faa764121'
down_revision: Union[str, None] = 'ef8cf2222205'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('uq_document_collection_name_deleted'), 'document', type_='unique')
    op.create_index('uq_document_collection_name_active', 'document', ['collection_id', 'name'], unique=True, postgresql_where=sa.text('gmt_deleted IS NULL'))
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('uq_document_collection_name_active', table_name='document', postgresql_where=sa.text('gmt_deleted IS NULL'))
    op.create_unique_constraint(op.f('uq_document_collection_name_deleted'), 'document', ['collection_id', 'name', 'gmt_deleted'])
    # ### end Alembic commands ###
